# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=wayshot
pkgver=1.1.7
pkgrel=0
pkgdesc="A native screenshot tool for wlroots based compositors"
url="https://github.com/waycrate/wayshot"
arch="aarch64 armhf armv7 ppc64le x86 x86_64"  # blocked by rust/cargo
license="BSD-2-Clause"
depends="wlroots"
makedepends="cargo"
source="https://github.com/waycrate/wayshot/archive/$pkgver/wayshot-$pkgver.tar.gz
	$pkgname-update-cargo-lock.patch::https://github.com/waycrate/wayshot/commit/5f0dbb94cb8b4b375168f8509ce8dd298967a3e8.patch
	"
options="!check"  # no tests provided

export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_OPT_LEVEL="s"
export CARGO_PROFILE_RELEASE_PANIC="abort"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build --frozen --release
}

package() {
	install -D -m755 target/release/wayshot -t "$pkgdir"/usr/bin/
}

sha512sums="
9c363a9efe91bf7fab260ad8625e9e66c40728c9ce692dabe64667f40dba42ef9621a631bd122bbebd3cc338736dc7f7e0770c36161feed82e57d87bfdd16c31  wayshot-1.1.7.tar.gz
3f55919ae44b2cd61033ac2e01da37cc631e42ef60684de5a104bbcfbe442c515ca8b5d1624df8f56aebb049baa50037199e170fda03431abc427e8b98f0cc6d  wayshot-update-cargo-lock.patch
"
